package com.iplatform.iplatformuser.privilege.service.inter;

import com.iplatform.commons.utils.CommResponse;
import com.iplatform.module.privilege.CompatibilityBean;
import com.iplatform.module.privilege.PriManagerBean;
import com.iplatform.module.privilege.PriMenuBean;
import com.iplatform.module.privilege.PriRoleBean;
import com.iplatform.module.privilege.group.PriGroupInfoBean;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Title: IPriRoleService Description:
 *
 * @author RayLLi
 * @date 2018年8月28日
 */
public interface IPriRoleService {

    /**
     * Title: findRoleByMrgId Description:
     *
     * @param mgrId
     * @return
     */
    List<PriRoleBean> findRoleByMrgId(String mgrId);

    /**
     * Title: loadRole Description:
     *
     * @param formMap
     * @return
     */
    List<PriRoleBean> loadRole(Map<String, String> formMap);

    /**
     * Title: insert Description:
     *
     * @param priRoleBean
     * @return
     */
    int insert(PriRoleBean priRoleBean);

    /**
     * Title: update Description:
     *
     * @param priRoleBean
     * @return
     */
    int update(PriRoleBean priRoleBean);

    /**
     * Title: delete Description:
     *
     * @param roleId
     */
    void delete(String roleId);

    /**
     * Title: batchDelete Description:
     *
     * @param roleIds
     */
    void batchDelete(String[] roleIds);

    /**
     * Title: setIsUse Description:
     *
     * @param roleId
     */
    void setIsUse(String roleId);

    /**
     * Title: querySelectManagerWithRoleId Description:
     *
     * @param formMap
     * @return
     */
    List<PriManagerBean> querySelectManagerWithRoleId(Map<String, String> formMap);

    /**
     * Title: querySelectManagerWithOutRoleId Description:
     *
     * @param formMap
     * @return
     */
    List<PriManagerBean> querySelectManagerWithOutRoleId(Map<String, String> formMap);

    /**
     * Title: updateManagerRole Description:
     *
     * @param roleId
     * @param checkedIds
     * @param createdBy
     */
    void updateManagerRole(String roleId, String checkedIds, String createdBy, boolean b);

    /**
     * Title: updateRoleMenuAndOpt Description:
     *
     * @param roleId
     * @param checkedMenuIds
     * @param checkedOptIds
     * @param createdBy
     */
    void updateRoleMenuAndOpt(String roleId, String[] checkedMenuIds, String[] checkedOptIds, String createdBy);

    /**
     * Title: queryAllOptByMenuIds Description:
     *
     * @param formMap
     * @return
     */
    List<Map<String, String>> queryAllOptByMenuIds(Map<String, String> formMap);

    /**
     * Title: selectTarget Description:
     *
     * @param targetId
     * @param roleId
     * @param createdBy
     */
    void selectTarget(String targetId, String roleId, String createdBy);

    /**
     * queryOrg
     *
     * @return
     */
    public List<CompatibilityBean> queryOrg();


    /**
     * Title: findGroupByRoleId
     * Description:
     *
     * @param roleId
     * @return
     */
    public List<PriGroupInfoBean> findGroupByRoleId(String roleId);


    /**
     * Title: queryRoleName
     * Description: 联想功能
     *
     * @param formMap
     * @return
     */
    List<Map<String, String>> queryRoleName();

    /**
     * 同步角色默认指标至用户
     *
     * @param formMap
     */
    void SynTarget(Map<String, String> formMap);

    /**
     * 移除角色用户绑定
     *
     * @param roleId
     * @param checkedIds
     * @param string
     */
    void delManagerRole(String roleId, String checkedIds, String string);

    /**
     * 角色未选中的默认指标列表
     *
     * @param formMap
     * @return
     */
    List<Map<String, String>> querySelectTargetWithOutRoleId(Map<String, String> formMap);

    /**
     * 角色已选中的默认指标列表
     *
     * @param formMap
     * @return
     */
    List<Map<String, String>> querySelectTargetWithRoleId(Map<String, String> formMap);

    /**
     * 角色绑定默认指标
     *
     * @param formMap
     */
    void updateTargetRole(Map<String, String> formMap);

    /**
     * 通过角色id获取绑定的菜单列表
     *
     * @param roleId
     * @return
     */
    List<PriMenuBean> queryMenuListWithRoleId(String roleId, String menuName);

    /**
     * 角色增加和修改时判重
     *
     * @param roleCode
     * @param roleId
     * @return
     */
    int addCheck(String roleCode, String roleId);

    /**
     * 角色绑定菜单
     *
     * @param roleId
     * @param menuIds
     * @return
     */
    CommResponse roleBindMenus(String roleId, String[] menuIds, BigDecimal version);

    /**
     * 移除绑定
     *
     * @param roleId
     * @param menuIds
     * @return
     */
    CommResponse removeBind(String roleId, String[] menuIds);
}
